package org.edith.shiro.util;

import org.edith.shiro.constant.SHA256Constant;
import org.apache.shiro.crypto.hash.SimpleHash;

/**
 *  Sha-256加密工具
 */
public class SHA256Util {
    private SHA256Util(){};

    /**
     * @param password 原密码
     * @param salt 盐值
     * @return 加密后的密码
     */
    public static String sha256(String password, String salt) {
        return new SimpleHash(SHA256Constant.HASH_ALGORITHM_NAME, password, salt, SHA256Constant.HASH_ITERATIONS).toString();
    }
}
